<?php
namespace Admin\Model;
use Think\Model;

/**
 * 用户模块
 * @author 
 *        
 */
class MemberModel extends Model
{
   protected $tableName = 'user';
   /**
    * 删除用户
    * @param string $uids
    */
   public function member_del($uids=''){
       if (is_array($uids)) {
           foreach ($uids as $k => $v) {
               if ($v == 1) {//uid为1的禁止删除
                   unset($uids[$k]);
               }
               $uids[$k] = intval($v);
           }
           if (!$uids) {
               return false;
               exit();
           }
       }
       
       $map['uid'] = array('in', $uids);
       if (M('user')->where($map)->delete()) {
           M('auth_group_access')->where($map)->delete();
           addlog('删除会员UID：' . $uids);
           return true;
       } else {
           return false;
       }
   }
   
   public function user_group(){
       $usergroup = M('auth_group')->field('id,title')->select();
       return $usergroup;
   }
   
   
}

?>